﻿using System;
using System.ComponentModel;

namespace RiskMan.DataClass.Models.Quik
{
    /// <summary>
    /// Таблица квик - таблица текущих параметров
    /// </summary>
    public class CurrentParamModel: INotifyPropertyChanged
    {
        private String _seccode;
        private String _classCode;
        private int _accurasy;
        private Double _stepPrice;
        private Double _maxPrice;
        private Double _minPrice;
        private Double _lastPrice;
        private int _quantity;
        private Double _closePrice;
        private Double _goSell;
        private Double _goBuy;
        private Double _stepPricet;


        /// <summary>
        /// код бамаги
        /// </summary>
        public String Seccode
        {
            get { return _seccode; }
            set
            {
                if (_seccode != value)
                {
                    _seccode = value;
                    RaisePropertyChanged("Seccode");
                }
            }
        }

        /// <summary>
        /// класс бумаги
        /// </summary>
        public String ClassCode
        {
            get { return _classCode; }
            set
            {
                if (_classCode != value)
                {
                    _classCode = value;
                    RaisePropertyChanged("ClassCode");
                }
            }
        }

        /// <summary>
        /// Точность
        /// </summary>
        public int Accurasy
        {
            get { return _accurasy; }
            set
            {
                if (_accurasy != value)
                {
                    _accurasy = value;
                    RaisePropertyChanged("Accurasy");
                }
            }
        }

        /// <summary>
        /// Шаг цены 
        /// </summary>
        public Double StepPrice
        {
            get { return _stepPrice; }
            set
            {
                if (_stepPrice != value)
                {
                    _stepPrice = value;
                    RaisePropertyChanged("StepPrice");
                }
            }
        }

        /// <summary>
        /// максимально возможная цена 
        /// </summary>
        public Double MaxPrice
        {
            get { return _maxPrice; }
            set
            {
                if (_maxPrice != value)
                {
                    _maxPrice = value;
                    RaisePropertyChanged("MaxPrice");
                }
            }
        }

        /// <summary>
        /// минимально возможная цена
        /// </summary>
        public Double MinPrice
        {
            get { return _minPrice; }
            set
            {
                if (_minPrice != value)
                {
                    _minPrice = value;
                    RaisePropertyChanged("MinPrice");
                }
            }
        }

        /// <summary>
        /// цена последней сделки
        /// </summary>
        public Double LastPrice
        {
            get { return _lastPrice; }
            set
            {
                if (_lastPrice != value)
                {
                    _lastPrice = value;
                    RaisePropertyChanged("LastPrice");
                }
            }
        }

        /// <summary>
        /// Лот
        /// </summary>
        public int Quantity
        {
            get { return _quantity; }
            set
            {
                if (_quantity != value)
                {
                    _quantity = value;
                    RaisePropertyChanged("Quantity");
                }
            }
        }

        /// <summary>
        /// Цена закрытия
        /// </summary>
        public Double ClosePrice
        {
            get { return _closePrice; }
            set
            {
                if (_closePrice != value)
                {
                    _closePrice = value;
                    RaisePropertyChanged("ClosePrice");
                }
            }
        }

        /// <summary>
        /// го продавца
        /// </summary>
        public Double GoSell
        {
            get { return _goSell; }
            set
            {
                if (_goSell != value)
                {
                    _goSell = value;
                    RaisePropertyChanged("GoSell");
                }
            }
        }

        /// <summary>
        /// го покупателя
        /// </summary>
        public Double GoBuy
        {
            get { return _goBuy; }
            set
            {
                if (_goBuy != value)
                {
                    _goBuy = value;
                    RaisePropertyChanged("GoBuy");
                }
            }
        }

        /// <summary>
        /// стоимость шага цены
        /// </summary>
        public Double StepPricet
        {
            get { return _stepPricet; }
            set
            {
                if (_stepPricet != value)
                {
                    _stepPricet = value;
                    RaisePropertyChanged("StepPricet");
                }
            }
        }



        ///// <summary>
        ///// 
        ///// </summary>
        //public String Seccode { get; set; }

        ///// <summary>
        ///// класс бумаги
        ///// </summary>
        //public String ClassCode { get; set; }

        ///// <summary>
        ///// Точность
        ///// </summary>
        //public int Accurasy { get; set; }

        ///// <summary>
        ///// Шаг цены 
        ///// </summary>
        //public Double StepPrice { get; set; }

        ///// <summary>
        ///// максимально возможная цена 
        ///// </summary>
        //public Double MaxPrice { get; set; }

        ///// <summary>
        ///// минимально возможная цена
        ///// </summary>
        //public Double MinPrice { get; set; }

        ///// <summary>
        ///// цена последней сделки
        ///// </summary>
        //public Double LastPrice { get; set; }

        ///// <summary>
        ///// Лот
        ///// </summary>
        //public int Quantity { get; set; }

        ///// <summary>
        ///// Цена закрытия
        ///// </summary>
        //public double ClosePrice { get; set; }

        ///// <summary>
        ///// го продавца
        ///// </summary>
        //public double GoSell { get; set; }

        ///// <summary>
        ///// го покупателя
        ///// </summary>
        //public double GoBuy { get; set; }

        ///// <summary>
        ///// стоимость шага цены
        ///// </summary>
        //public double StepPricet { get; set; }


        #region event PropertyChangedEventHandler

        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
}
